Skip to content

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

Partially address perf hit discussed in #41929

import numpy as np
from pandas import *

N = 10**5

left = np.append(np.arange(N), np.array(0))
right = np.append(np.arange(1, N + 1), np.array(1))
intv = IntervalIndex.from_arrays(left, right)

intv2 = IntervalIndex.from_arrays(left + 1, right + 1)

%timeit intv.intersection(intv2)
122 ms ± 2.34 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- PR
263 ms ± 5.98 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # <- master

xref #36482

@jreback jreback added the Interval Interval data type label Jun 25, 2021
@jreback jreback modified the milestones: 1.4, 1.3 Jun 25, 2021
@jreback jreback merged commit d61ace5 into pandas-dev:master Jun 25, 2021
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Jun 25, 2021
@jreback
Copy link
Contributor

jreback commented Jun 25, 2021

@meeseeksdev backport 1.3.x

@lumberbot-app
Copy link

lumberbot-app bot commented Jun 25, 2021

Something went wrong ... Please have a look at my logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interval Interval data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants